#pragma strict

public var target : Transform;
public var correctZ : boolean = false;

function Update ()
{
	if(!target) return;
	var lookRotation : Quaternion = Quaternion.LookRotation(target.position - transform.position);
	if(correctZ)
	{lookRotation *= Quaternion.Euler(0, 0, 270);}
    transform.rotation = lookRotation;
}